<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title>出库查询</title>
<script type="text/javascript">
    //num 1为出库 2为退货 3为盘点 4为标签(实为打印）
    function outStock(num) {
        var obj =    document.getElementsByName('ppid[]');
        var s = "";
        for (var i=0;i<obj.length;i++)
        {
                if(obj[i].checked) s+=obj[i].value+','; //如果选中，将value添加到变量s中
        }
        if(!s){
            alert("未选择任何商品!");return false;
        }
        if(num==1){
            var url = "/stocks/ajaxbutton?op=outStocks&s="+s+"&num="+num;
            //alert(url);return ;
        }
        if(num==2){
            var url = "/stocks/ajaxbutton?op=returnGoods&s="+s+"&num="+num;
        }
        if(num==3){
            var url = "/stocks/ajaxbutton?op=checkGoods&s="+s+"&num="+num;
        }
        if(num==4){
            var url = "/stocks/ajaxbutton?op=printGoods&s="+s+"&num="+num;
        }
        location.href = url;
        return false;
    }


</script>
<body class="withvernav">
<div class="bodywrapper">
    {{include file='/public/leftmenu.tpl'}}
    <div class="centercontent">
        <div class="pageheader notab">
            <h1 class="pagetitle">出库查询</h1>
            <span class="pagedesc"></span>
        </div>
        <!--pageheader-->
        <div id="contentwrapper" class="contentwrapper">
            <div id="basicform" class="subcontent">
                <!--搜索栏-->
                <div>
                    <div class="page">{{$pageList}} 计{{$total}}条记录，共{{$totalpage}}页</div>
                </div>
                <form class="stdform stdform2" method="get" id="search">
                        <a href="javascript:void();" onClick="outStock(1)">
                            <button type="button" class="btn btn_orange btn_search radius50">出库</button>
                        </a>
                        <a href="javascript:void();" onClick="outStock(2)">
                        <button type="button" class="btn btn_orange btn_search radius50">退货</button>
                        </a>
                        <a href="javascript:void();" onClick="outStock(3)">
                            <button type="button" class="btn btn_orange btn_search radius50">盘点</button>
                        </a>
                        <a href="javascript:void();" onClick="outStock(4)">
                            <button type="button" class="btn btn_orange btn_search radius50">标签</button>
                        </a>
                    </div>
                </form>
                <!--搜索栏结束-->
                <table cellpadding="0" cellspacing="0" border="0" class="stdtable">
                    <thead>
                    <tr class="lbbt">
                        <td bgcolor="#FEFFF1">
                            <a onClick="allSelect('ppid[]')">全选<input type="checkbox"></a>
                        </td>
                        <td  bgcolor="#FEFFF1">商品编号</td>
                        <td  bgcolor="#FEFFF1">商品名称</td>
                        <td  bgcolor="#FEFFF1">库存数量</td>
                        <td  bgcolor="#FEFFF1">警戒库存</td>
                        <td  bgcolor="#FEFFF1">产品型号</td>
                        <td  bgcolor="#FEFFF1">修改人</td>
                        <td  bgcolor="#FEFFF1">操作</td>
                    </tr>
                    </thead>
                    <tbody >
                    {{foreach from=$stocklist item=li key=key}}
                    <tr>
                        <td bgcolor="#FEFFF1">
                            <input name="ppid[]" type="checkbox" class="none" id="ppid[]" value="{{$li.id}}"/>
                        </td>
                        <td  bgcolor="#FEFFF1">
                            <a href="/product/productlist?other={{{{$li.productsku}}}}">{{$li.productsku}}</a>
                        </td>
                        <td  bgcolor="#FEFFF1">{{$li.productname}}</td>
                        <td  bgcolor="#FEFFF1">{{$li.savenum}}</td>
                        <td  bgcolor="#FEFFF1">{{$li.alertnum}}</td>
                        <td  bgcolor="#FEFFF1">{{$li.producttypename}}</td>
                        <td  bgcolor="#FEFFF1">{{$li.updateoper}}</td>
                        <td bgcolor="#FFFFFF" class="cz">
                            <a href="/stocks/ajaxbutton?op=doShowStockLog&savenumid={{$li.id}}" style="color:dodgerblue;">查看</a>
                        </td>
                    </tr>
                    {{/foreach}}
                    </tbody>
                </table>
                <div class="page">{{$pageList}} 计{{$total}}条记录，共{{$totalpage}}页</div>
            </div>
        </div>
</body>
</html>